package work.shuangzhizhen;

import java.util.Arrays;

public class Problem27 {
    public int removeElement(int[] nums, int val) {
        int head = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != val) {
                nums[head] = nums[i];
                head++;
            }


        }
        return head;

    }

    public static void main(String[] args) {
        Problem27 problem27 = new Problem27();
        int[] next = new int[]{3, 2, 2, 3};
        problem27.removeElement(next, 3);
    }
}
